<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">
<Title>HTTP Transport</Title><link rel="STYLESHEET" type="text/css" href="styles.css">
</HEAD>
<BODY>
<h1>HTTP Transport</h1>

The HTTP transport object includes many useful features, here's a run down on what it does, and how you use it.

<h2>Proxy Server Support</h2>
The HTTP transport supports sending requires via a proxy server, it also supports authenticating proxy servers, where you need
to supply a username &amp; password for the proxy server to accept your request.<BR>
<BR>
By default the HTTP transport object will attempt to make a direct connection to the server, call the <b>SetProxy</b> method to tell it to 
use a proxy server instead. If you also need to authenticate with the proxy server, call <b>ProxyAuthentication</b>.
<pre class="sample">
dim http
set http = CreateObject("pocketSOAP.HTTPTransport.2")
' name of the proxy server and port, note that the name shouldn't have a preceeding http://
http.SetProxy "proxy.mydomain.com", 7070

' authentication info for proxy server
http.ProxyAuthentication "myUserName","MyPassword"
....
</pre>

<h2>Basic Authentication</h2>
The HTTP transport supports servers that require authentication using the basic authentication protocol. Simply call the <b>Authentication</b> method
before calling send, specifying the username and password to use.
<pre class="sample">
dim http
set http = CreateObject("pocketSOAP.HTTPTransport.2")
http.Authentication "MyUserName", "MyPassword"
http.Send "http://soap.example.org/", e.serialize
...
</pre>

<h2>SSL</h2>
The HTTP transport supports SSL connections, simply use a https:// url as the endpoint rather than the normal http://
<pre class="sample">
dim http
set http = CreateObject("pocketSOAP.HTTPTransport.2")
http.send "https://soap.example.org/" e.serialize
</pre>

<h2>Timeouts</h2>
By default the HTTP transport uses a 15 second timeout for sends and receives, this can be altered via the <b>TimeOut</b> property as needed.<BR>

<h2>Session Cookies</h2>
Non persistent cookies are automatically supported by the transport, and are tied to a particular instance of the transport. If you are calling
an endpoint that requires you to round trip session cookies, simply re-use the same instance of the transport object.
<pre class="sample">
dim http 
set http = CreateObject("pocketSOAP.HTTPTransport.2")

' build a login SOAP request, and send it via this instance of the transport object.
' the server returns a cookie, which the transport object remembers
SendLoginRequest  "Username", "password", http 

' build a quote request, and send it via this isntance of the transport object
' the previous received cookie will be automatically sent to the server, maintaining the server based session setup earlier
SendQuoteRequest "INTC", http
</pre>

<h2>Redirects</h2>
The transport object can automatically follow redirects set by the server, until a certain redirect depth is reached [the default is 5]. You
can change this by altering the <b>MaxRedirectDepth</b> property. However for security reasons this is disabled by default, to enable this
feature call the Option method to turn on the "redirects.onpost" option.

<h2>Compression</h2>
By default the outgoing request will be uncompressed, and there will be a HTTP header that indicates
that we can handle a compressed response. If the server supports compressed requests, then you can
enable compression of the outgoing request by setting the <b>compression.enabled</b> named option
to true ( e.g. t.option("compression.enabled") = true ) before calling t.send.

<BR><BR><BR>
<h3>Copyright</h3>
<p>Copyright &copy; Simon Fell, 2000-2004. All rights reserved.<br>

</BODY>
</HTML>
